<?php

namespace Core\Service\Parameterchooser;

use Core\Helper\CommonHelper;

class ParameterChooserCategory implements ParameterChooserInterface
{


    public function genHtml()
    {
        $rand_string = CommonHelper::rand_string(4);
        $html = '<input class="k-textbox txt_param_holder" required id="txtCategory_'.$rand_string.'" name="txtCategory_'.$rand_string.'" validationMessage="Chưa chọn nhóm">
        <span class="k-invalid-msg" data-for="txtCategory_'.$rand_string.'"></span>';
        $javascript = '<script type="text/javascript">
            $("#txtCategory_'.$rand_string.'").lov({dataSource:"category", name:"Nhóm"});
        </script>';


        return $html.$javascript;

    }
}
